/**
 * 商品
 * @author [chencheng]
 */
const $http = require('../utils/http.js'), api = require('../config/api.js')


/**
 * 获取单个商品详情
 */
var _getGoodsDetail = function(params) {
  return $http.get(api.GET_GOOD_DETAIL, params)
}

/**
 * 获取商品分类
 */
var _getGoodsKinds = function(params) {
  return $http.get(api.GET_GOODS_KINDS, params)
}

/**
 * 根据商品分类获取商品
 */
var _getGoodsByGoodsKind = function(params) {
  return $http.get(api.GET_GOODS_BY_GOODS_KIND, params)
}

/**
 * 获取当前商品开团人列表
 */
var _listXcxOpenGroup = function (params) {
  return $http.get(api.LIST_XCX_OPEN_GROUP, params)
}

/**
 * banner广告
 */
var _xcxListAdvert = function (params) {
  return $http.get(api.XCX_LIST_ADVERT, params)
}

module.exports = {
  getGoodsDetail: _getGoodsDetail,
  getGoodsKinds: _getGoodsKinds,
  getGoodsByGoodsKind: _getGoodsByGoodsKind,
  listXcxOpenGroup: _listXcxOpenGroup,
  xcxListAdvert: _xcxListAdvert
}